package com.Controller;

import com.Service.StudentService;
import com.Service.UserService;
import com.Service.impl.UserServiceImpl;
import com.domain.Student;
import com.domain.User;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;


@Controller
public class LoginServlet {
        @Autowired
        private UserService userService;
            @RequestMapping("/LoginServlet")
            @ResponseBody
            public String login(User user){
                User u = userService.findId(user);
                if (u != null){
                    return "true";
                }else {
                     return "false";
                }
        }
}
